<template>
    <el-menu class="el-menu-demo" mode="horizontal" @select="handleSelect">
    <el-menu-item index="1">实时在线统计1</el-menu-item>
    <el-submenu index="2">
        <template slot="title">查询统计</template>
        <el-menu-item index="2-1">垃圾作业报表下载</el-menu-item>
    </el-submenu>
    <el-submenu index="3">
        <template slot="title">出车统计</template>
        <el-menu-item index="3-1">按出行距离统计</el-menu-item>
        <el-menu-item index="3-2">按作业点数统计</el-menu-item>
    </el-submenu>
    <el-menu-item index="4">视频监控</el-menu-item>
    </el-menu>
</template>

<script>
import eventBus from '@/eventBus.js'

// // 作业区域道路设定
// import WorkAreaList from '@/views/CleanerWork/TopToolbar/WorkAreaList.vue'
// // 组织机构
// import Organization from '@/views/CleanerWork/TopToolbar/Organization.vue'
// // 人员管理
// import PersonManagement from '@/views/CleanerWork/TopToolbar/PersonManagement.vue'
// // 考勤管理
// import Attendance from '@/views/CleanerWork/TopToolbar/Attendance.vue'
// //查询统计 
// import queryStatistics from '@/views/CleanerWork/TopToolbar/QueryStatistics.vue'
//查询统计 
import zylxz from '@/views/CleanerWork/TopToolbar/zylxz.vue'
export default {
  data(){
    return{
       // 是否显示实时在线统计对话框
        Visible: false,
        statisticalData: [],
        MouseEvent: {
          top: 0,
          left: 0,
          isShow: false
        },
        Visible2:false,
        // YZT:{
        //   show:false,
        //   startTime:'',
        //   endTime:''
        // }
    }
  },
  methods: {
    handleSelect(key, keyPath) {
        console.log(key, keyPath)
        if (key === '1') {
            this.onlineStatistics()
        }
        if (key === '4') {
            this.showHaobaoPage()
        }
        if (key === '2-1') {
            // zylxz.openAttendanceRecords()
            eventBus.$emit('topToolBar2_1', '2-1')
        }
    },
    // openYZT(){
    //   this.$refs.attendance.openYZT()
    // },
    showHaobaoPage () {
      var url = 'http://111.160.78.62:88/808gps/index.html?account=bhclc&password=bhclc&clientLogin=2'
      window.open(url);
    },
    // 实时在线统计
    async onlineStatistics () {
      this.Visible = true
      // var url = `/InspectionGuidance/GetWorkerStatisticsInfoApi?StreetNo=${this.$route.query.StreetNo}`
      // http://111.160.78.62:9942/GarbagePointsApi/InspectionGuidance/GetWorkerStatisticsInfoApi?StreetNo=2
      var url = '/DataListCompany/GetRealTimeOnlineApi?ClientNo=0000019'
      const { data } = await this.$Http.get(url)
      this.statisticalData = data
      eventBus.$emit('isCover', this.Visible)
    },
    // 关闭实时在线统计
    close () {
      this.Visible = false
      eventBus.$emit('isCover', this.Visible)
    },
    //用户管理
    // userstration () {
    // this.$refs.usermanage.personManage()
    // },
    //区域道路设定
    // area(){
    // this.$refs.areawork.openPersonnelRoad();
    // },
  }
}
</script>

<style scoped lang="less">
</style>